package com.xms.core.model;

import java.io.Serializable;
import java.util.HashMap;

/**
 * <p>
 * KeyValuePair
 * </p>
 *
 * @author migo
 * @since 2021/9/3
 */
public class KeyValuePair<ktype, vtype> extends HashMap<ktype, vtype> implements Serializable {

    public KeyValuePair(ktype k, vtype v) {
        super.put(k, v);
    }

    public static <ktype, vtype> KeyValuePair<ktype, vtype> build(ktype k, vtype v){
        return new KeyValuePair<>(k, v);
    }

    public KeyValuePair<ktype, vtype> set(ktype k, vtype v){
        this.put(k, v);
        return this;
    }
}
